<?php

namespace app\validate;

use share\validate\SceneValidate;

class AppViewValidate extends SceneValidate{
    protected $rule = [      
        'id' => 'require|integer',
        'package' =>  'require|max:64',
        'vendor' => 'require|max:64',
        'clientType' => 'require|integer',
        'version' => 'require|max:20',
        'inland' => 'require|integer',
        'module' => 'array',
        'priority' => 'integer',
    ];  
    
    protected $sceneRules = [
        'list' => [
            'package' =>  'require|max:64',
            'vendor' => 'require|max:64',
            'version' => 'require|max:20',
            'module' => 'string|max:100',
        ]
    ];

    protected $scene = [
        'edit' => ['id','package','vendor','clientType','version','inland','module','priority'],
        'copy' => ['id'],
        'del' => ['id'],
        'detail' => ['id'],
        'list' => ['vendor','package','version','module'],
        'check' => ['package','vendor','clientType','version','inland'],
        'match' => ['package','vendor','clientType','version','inland'],
    ];
}